#pragma once
#include <vector>
#include <type_traits>

enum class WeightType {
    FP32_W,
    FP16_W,
    INT8_W,
    UNSUPPORT_W
};

template<typename T>
inline WeightType getWeightType() {
    if (std::is_same<T, float>::value || std::is_same<T, const float>::value) {
        return WeightType::FP32_W;
    }
    if (std::is_same<T, half>::value || std::is_same<T, const half>::value) {
        return WeightType::FP16_W;
    }
    if (std::is_same<T, int8_t>::value || std::is_same<T, const int8_t>::value) {
        return WeightType::INT8_W;
    }
    return WeightType::UNSUPPORT_W;
}


template<typename T>
struct BaseWeight {
    std::vector<int> shape;
    T *data;
    T *bias;    // bias 和 data 二选一，必有一个为nullptr
    WeightType type;
};